﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class Publish_ucMenu : System.Web.UI.UserControl
{
    protected int m_Count = 0;
    protected void Page_Load(object sender, EventArgs e)
    {
        DataSet ds = new DataSet();
        ds.ReadXml(AppDomain.CurrentDomain.BaseDirectory + @"App_Data\productmenu.xml");
        DataTable dt = ds.Tables[0];
        m_Count = dt.Rows.Count;
        rptProductMenu.DataSource = dt;
        rptProductMenu.DataBind();
        dt.Dispose();
        ds.Dispose();
    }

    protected string ReadSubMenu()
    {
        string rs = "";
        try
        {
            System.IO.StreamReader sr = new System.IO.StreamReader(AppDomain.CurrentDomain.BaseDirectory + @"App_Data\productsubmenu.txt");
            rs = sr.ReadToEnd();
            sr.Close();
        }
        catch (Exception ex)
        {
            string str = ex.ToString();
            rs = "";
            str = "";
        }
        return rs;
    }
}
